import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

export type infoType = {

	id?: number,
	projectName?: string,
	recordType?: number,
	recordNum?: number,
	remainNum?: number,
	remark?: string,
	createdAt?: string,
}
export type infoTypeList = {
  recharge: number,
  alarmUse: number,
  insecUse: number,
  workOrderUse: number,
  data: infoType[];
  total: number;
};

const List = '/business/setmel/setmel/v2/record';
const Url = '/business/setmel/setmel/v2/record';
export const getList = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", List, {
    params
  });
};
export const getInfo = (params?: object) => {
  return http.request<commonResult<infoType>>("get", Url, {
    params
  });
};
export const addInfo = (data?: object) => {
  return http.request<commonResult<any>>("post", Url, {
    data
  });
};
export const editInfo = (data?: object) => {
  return http.request<commonResult<any>>("put", Url, {
    data
  });
};
export const deleteInfo = (data?: object) => {
  return http.request<commonResult<any>>("delete", Url, {
    data
  });
};
